<%@ include file="/WEB-INF/view/include.jsp"%>
<%@page import="ae.pcfc.etks.online.itworx.ehs.web.constants.GlobalConstants"%>
<%@page import="ae.pcfc.etks.online.itworx.ehs.web.entity.DocumentType"%>
<!-- % request.setCharacterEncoding("UTF-8"); %-->
<script>
function submitForm(){
	document.getElementById("deleteDocument").submit();	
	//parent.$.fn.colorbox.close();
	//window.location.reload();
}

</script>
<div class="popup_container add_edit_document">
<%
if(null != request.getAttribute("deleteStatus") && request.getAttribute("deleteStatus").equals("true")){
%>
	<fieldset class="clear">
            <legend>Delete Document Type</legend>
    </fieldset>
    
    <div class="error_dark">
		<img src="resources/images/confirmed.png" />Document Type has been successfully Deleted
	</div>
	<div class="popup_btn">
		
		<span class="btn_border">
			<button type="button" class="btn_bg" onclick="parent.$.fn.colorbox.close();">Close</button> 
		</span>
		
	</div>
<%
}else{
%>

	<form:form modelAttribute="documentTypeItem"
	name="deleteDocument" id="deleteDocument" method="POST"
	action="admin/deleteDocument.htm" enctype="text/html;charset=UTF-8">
	
		
    <fieldset class="clear">
        <legend>Delete Document Type</legend>
    </fieldset>
        
    <div class="error_msg"><spring:bind path="documentTypeItem.*"><c:if test="${not empty status.errorMessages}"><img src="resources/images/failure.png" /></c:if><c:forEach items="${status.errorMessages}" var="error"><c:out value="${error}" /><br /></c:forEach></spring:bind></div>
	<div style="display: none">
		<div class="t_form-left fnp_form">
			<label>English Title:</label>
			<form:input path="englishName" type="text" class="fnp_form-fld" maxlength="50"/>
			<br/>
			<label>English Description:</label>
	                    <form:textarea path="englishDescription" type="text" cols="46" rows="2" maxlength="100"/>
	                    <br/>
	                    <label>Arabic Title:</label>
			<form:input path="arabicName" type="text" class="fnp_form-fld" maxlength="50"/>
			<br/>
			<label>Arabic Description:</label>
	                    <form:textarea path="arabicDescription" type="text" cols="46" rows="2" maxlength="100"/>
	                    <br/>
	         <form:input type="hidden" path="id"/>
		<form:input type="hidden" path="removable" value="${removable}"/>
		<form:input type="hidden" path="status" value="${status}"/>
		<input type="hidden" name="type" id="type" value="manageDocument"/>
			
		</div>
	</div>
	<div class="error_dark">
		<table align="left">
			<tr>
				<td>
					<img src="resources/images/warning.png" align="top"/>
				</td>
				<td>Are you sure you want to delete Document Type: ${documentTypeItem.englishName}</td>
			</tr>
		</table>
	</div>
	<div class="popup_btn">
			
		<span class="btn_border">
			<button type="button" class="btn_bg" onclick="submitForm();">Delete</button> 
		</span>
		<span class="btn_border">
			<button type="button" class="btn_bg" onclick="parent.$.fn.colorbox.close();">Close</button> 
		</span>
		
	</div>
		
	</form:form>
	
<%
}
%>
</div>
<!-- table>

<c:forEach var="documentType" items="${documentTypeList}" varStatus="loopStatus">
		<tr ${loopStatus.index % 2 == 0 ? 'class="grdAltRow"' : ''}>
			<td>${documentType.englishName}</td>
			<td>${documentType.englishDescription}</td>
			<td>${documentType.arabicName}</td>
			<td>${documentType.arabicDescription}</td>
			<td class="actions">
				<c:if test="${documentType.removable}">
					<a href="/admin/manageDocument.htm?type=edit&docTypeId=${documentType.id}" class="admin_actions fancy_popup_mange_doc iframe">
						<img src="resources/images/common/view_icon.png" /></a>
					<a href="/admin/manageDocument.htm?type=delete&docTypeId=${documentType.id}" class="hide_on_click" onclick="return confirm('Confirm Delete Document Type: Continue?');">
						<img src="resources/images/common/delete.gif" /></a>
				</c:if>
	        </td>
		</tr>
	</c:forEach>
	


</table -->